package com.hq.modeapp.adapter;

import java.util.ArrayList;

import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
/**
 * **********************************************************
 *  ����ժҪ	��<p>
 *	viewPager������
 *  ����	��zcy
 *  ����ʱ��	��2012-12-11 ����6:34:56 
 *  ��ǰ�汾�ţ�
 *  ��ʷ��¼	:
 *  	����	: 2012-12-11 ����6:34:56 	�޸��ˣ�zcy
 *  	����	:
 ***********************************************************
 */
public class myPagerAdapter extends PagerAdapter {


	ArrayList<View> imageList;
	
	
	
	public myPagerAdapter(ArrayList<View> imageList2) {
		// TODO Auto-generated constructor stub
		this.imageList=imageList2;
	}

	@Override
	public int getCount() {
		return imageList.size();
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0 == arg1;
	}

	@Override
	public int getItemPosition(Object object) {
		// TODO Auto-generated method stub
		return POSITION_NONE;
	}

	@Override
	public void destroyItem(View arg0, int arg1, Object arg2) {
		// TODO Auto-generated method stub
		
	    if (getCount() > 1) {  
            ((ViewPager) arg0).removeView(imageList.get(arg1));  
        } 
	}

	@Override
	public Object instantiateItem(View arg0, int arg1) {
		// TODO Auto-generated method stub
		((ViewPager) arg0).addView(imageList.get(arg1));
		return imageList.get(arg1);
	}

	@Override
	public void restoreState(Parcelable arg0, ClassLoader arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public Parcelable saveState() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void startUpdate(View arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void finishUpdate(View arg0) {
		// TODO Auto-generated method stub

	}
}
